
package com.lungle.warmdiary.app.view.testcampaign;

import com.lungle.warmdiary.R;
import com.lungle.warmdiary.app.view.testcampaign.fragment.CampaignDetailFragment;
import com.lungle.warmdiary.app.view.testcampaign.fragment.CampaignDetailListPagerFragment;


public enum CampaignDetailTab {
    CAMPAIGN_DETAIL(0,0,R.string.frame_title_campaign_detail, CampaignDetailFragment.class),
    CAMPAIGN_DETAIL_LIST(1,0,R.string.frame_title_campaign_detail_list,CampaignDetailListPagerFragment.class);

    private Class<?> clz;
    private int idx;
    private int title;
    private int catalog;

    private CampaignDetailTab(int idx, int catalog, int title, Class<?> clz) {
        this.idx = idx;
        this.clz = clz;
        this.setCatalog(catalog);
        this.setTitle(title);
    }

    public static CampaignDetailTab getTabByIdx(int idx) {
        for (CampaignDetailTab t : values()) {
            if (t.getIdx() == idx)
                return t;
        }
        return CAMPAIGN_DETAIL;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public int getCatalog() {
        return catalog;
    }

    public void setCatalog(int catalog) {
        this.catalog = catalog;
    }
}
